{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Liner Regression Model Tutorial\n",
    "\n",
    "***\n",
    "\n",
    "## Introduction:\n",
    "\n",
    "Since the early years of humanity, there has always been a desire to predict future outcomes before they happened. The Ancient Greeks used Oracles, or divine priestesses, to predict the future by listening to their supposed messages from the Gods. The Ancient Chinese would engrave messages on bones, mashup and heat the bones, and then use the priest to interpret the answers returned by divine entities. While their approaches may have been different, the goal was the same: **predict an outcome before it happened.**\n",
    "\n",
    "As time went on, humanity developed and invented new fields of study related to mathematics and statistics. These topics would help scientist and mathematicians develop new ways to explore their world and devise more realistic means of prediction that were grounded in observations and data.\n",
    "\n",
    "**However, all these models required data that could be measured and manipulated, something that was challenging to obtain before the advent of the computer.** Enter the age of the modern computer, and data went from a scarce asset to an overly abundant commodity that required new technologies to handle and analyzes.\n",
    "\n",
    "The combination of a large amount of data & powerful computers that could compute more numbers in a few minutes than a single person could in their entire life, meant we could make models more accurate and dynamic than ever before. Soon, the field of machine learning would take off as individuals realized they could create computer programs that could learn from all of this data. New models were developed to handle different types of data and problems, and a repository of new techniques could be referenced to devise new solutions to old problems.\n",
    "\n",
    "One of the models we will discuss in this series is the Linear Regression Model. **The Linear Regression Model attempts to model the relationship between two variables by fitting a linear equation (a line) to observed data**. In the model, one variable is considered to be an **explanatory variable** (X Variable), and the other is considered to be a **dependent variable** (Y Variable)."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Background:\n",
    "\n",
    "In our example, we are going to try an model the relationships between two financial assets, the price of a single share of Exxon Mobile stock and the price of a barrel of oil. **The question we are trying to answer is, does the explanatory variable (Oil) do a good job at predicting the dependent variable (a single share of Exxon Mobile stock.)**\n",
    "\n",
    "### Why a linear regression model?\n",
    "There are so many models to choose from, why this one? Well there can be many reasons why we would choose a given model, but there were a few key reasons why a linear regression model is being selected for this example\n",
    "\n",
    "> - We want to know whether one measurement variable is associated with another measurement variable.\n",
    "> - We want to measure the strength of the association (r2).\n",
    "> - We want an equation that describes the relationship and can be used to predict unknown values."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "***\n",
    "The linear model will take the following form:\n",
    "\n",
    "$y = \\beta_0 + \\beta_1x$\n",
    "\n",
    "Where each term represents:\n",
    "\n",
    "- $y$ is the response\n",
    "- $x$ is the feature\n",
    "- $\\beta_0$ is the intercept\n",
    "- $\\beta_1$ is the coefficient for x"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Step One: Import our libraries\n",
    "To build our model, we will need some tools at our disposal to make the process as seamless as possible. We will not go through all the libraries but will take the time to explain a few.\n",
    "\n",
    "1. **Pandas** - This will make grabbing and transforming the data quick.\n",
    "2. **Sklearn** - We can leverage the built-in machine learning models they have.\n",
    "3. **Scipy** - This will make interpreting our output much more comfortable.\n",
    "4. **Matplotlib** - Visuals are critical to analysis, and this library will help us build those visuals."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "#https://matplotlib.org/gallery/color/named_colors.html\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "import statsmodels.api as sm\n",
    "import math \n",
    "\n",
    "from sklearn.model_selection import train_test_split\n",
    "from sklearn.linear_model import LinearRegression\n",
    "from sklearn.metrics import mean_squared_error, r2_score, mean_absolute_error\n",
    "\n",
    "from scipy import stats\n",
    "from scipy.stats import kurtosis, skew\n",
    "\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "***\n",
    "## Step Two: Load the Data\n",
    "We want our data in a DataFrame as this will give it the proper structure need to analyze the data. Once we load the data into a DataFrame, we need an index so we will set that equal to our date column. Finally, it is good to check the data looks correct before moving on, so let us print out the first five rows using the `head()` method."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>exon_price</th>\n",
       "      <th>oil_price</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2014-03-28</th>\n",
       "      <td>97.699997</td>\n",
       "      <td>106.64</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2014-03-31</th>\n",
       "      <td>97.680000</td>\n",
       "      <td>105.95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2014-04-01</th>\n",
       "      <td>97.730003</td>\n",
       "      <td>105.70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2014-04-02</th>\n",
       "      <td>97.949997</td>\n",
       "      <td>103.37</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2014-04-03</th>\n",
       "      <td>97.930000</td>\n",
       "      <td>104.88</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            exon_price  oil_price\n",
       "date                             \n",
       "2014-03-28   97.699997     106.64\n",
       "2014-03-31   97.680000     105.95\n",
       "2014-04-01   97.730003     105.70\n",
       "2014-04-02   97.949997     103.37\n",
       "2014-04-03   97.930000     104.88"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# load the data\n",
    "#path =r\"C:\\Users\\305197\\OneDrive - Petco Animal Supplies\\OneDrive-2019-03-29\\oil_exxon.xlsx\"\n",
    "path =r\"C:\\Users\\Alex\\OneDrive\\Growth - Tutorial Videos\\Lessons - Python\\Python For Finance\\oil_exxon.xlsx\"\n",
    "price_data = pd.read_excel(path)\n",
    "\n",
    "# set the index equal to the date column & then drop the old date column\n",
    "price_data.index = pd.to_datetime(price_data['date'])\n",
    "price_data = price_data.drop(['date'], axis = 1)\n",
    "\n",
    "# print the first five rows\n",
    "price_data.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "***\n",
    "## Step Three: Clean the data\n",
    "The chances of getting a perfectly cleaned dataset that meets all of the requirements is slim to none, so to make this tutorial more realistic we will clean the data. Here is the checklist when it comes to cleaning the data:\n",
    "\n",
    "> 1. Check the data types, to make sure they are correct. For example, it usually does not make sense for a number to be a string.\n",
    "> 2. Make sure the column names are correct. Having the correct column names makes the process of selecting data easier.\n",
    "> 3. Check for and drop/fill missing values. Dropping errors helps to control for errors when running."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "exon_price    float64\n",
       "oil_price     float64\n",
       "dtype: object"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# check the data types, in this case everything looks fine no changes need to be made.\n",
    "price_data.dtypes"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "While looking at the data, we can see one of the columns is misspelled, so let us fix that by creating a dictionary object where the old name is the key, and the new name is the value for that key. Once we do that, we can call the `rename()` method on the DataFrame and pass through the `new_column_names` dictionary through the `columns` parameter."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>exxon_price</th>\n",
       "      <th>oil_price</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2014-03-28</th>\n",
       "      <td>97.699997</td>\n",
       "      <td>106.64</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2014-03-31</th>\n",
       "      <td>97.680000</td>\n",
       "      <td>105.95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2014-04-01</th>\n",
       "      <td>97.730003</td>\n",
       "      <td>105.70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2014-04-02</th>\n",
       "      <td>97.949997</td>\n",
       "      <td>103.37</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2014-04-03</th>\n",
       "      <td>97.930000</td>\n",
       "      <td>104.88</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            exxon_price  oil_price\n",
       "date                              \n",
       "2014-03-28    97.699997     106.64\n",
       "2014-03-31    97.680000     105.95\n",
       "2014-04-01    97.730003     105.70\n",
       "2014-04-02    97.949997     103.37\n",
       "2014-04-03    97.930000     104.88"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# define the new name.\n",
    "new_column_names = {'exon_price':'exxon_price'}\n",
    "\n",
    "# rename the column\n",
    "price_data = price_data.rename(columns = new_column_names)\n",
    "price_data.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Missing values, they can be a problem because they can create errors when running calcs. The first thing is we should always check to see if there are any missing values. If we use the `.isna().any()` method on the DataFrame it will return each column with a boolean, where `True` means it has missing values and `False` means it does not have any missing values. Once, we know the data has missing values we can use the `dropna()` method to drop any rows that have a missing value."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "exxon_price    False\n",
       "oil_price       True\n",
       "dtype: bool"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "exxon_price    False\n",
       "oil_price      False\n",
       "dtype: bool"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# check for missing values\n",
    "display(price_data.isna().any())\n",
    "\n",
    "# drop any missing values\n",
    "price_data = price_data.dropna()\n",
    "\n",
    "# let's check to make sure they've all been removed.\n",
    "price_data.isna().any()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "***\n",
    "## Section Four: Explore the Data\n",
    "Okay, now that we have a clean dataset let us explore it a little. Again, this is a critical step as it helps us understand some of the following questions:\n",
    "\n",
    "1. How is the data distributed?\n",
    "2. Does there appear to be a relationship between the two variables?\n",
    "3. Are there any outliers?\n",
    "4. Is the data skewed?\n",
    "\n",
    "By better understanding the answers to these questions we can validate whether we need to do further transformations or if we need to change the model we picked."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "***\n",
    "### Build a Scatter Plot\n",
    "Scatter plots help us visualize the relationship between our data, so let us plot our data using the graph so we can explore the relationship. We need to define the x-coordinate and the y-coordinate, and then plot them using the `plot()` method. Now, we did a few formatting steps, so our graph comes out logically."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEWCAYAAAB8LwAVAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0c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bqVO++8E2MMzzzzDGvXrmXlypWsXLmSXC7/hXnmmWe44IILSp47PT3N0qVLi0Hh6elplixZws9/7j+Pfv78+SxevJgf//jHfOYzn2HLli1cccUV3HDDDSWWyYkTJ9i8eTO/9Vu/xYoVK3jwwQcB+M53vsOll17KypUref/738+JEyeqdi8UpVXJDY9wd2/fjAXfy/jUVHH98bM0xiYm6mZVtLSC8NPQDx44WNXXWbRoEdPT0xw9epT58+fz8MMPc/DgQe6///5Al09bWxvXX389O3fuBOCRRx7hwgsv5IwzzvB9zsjICCMjIyxZsgSAAwcO8NBDD7Fr166S8/78z/+c173udfzgBz/g0KFDvOMd7+DnP/85n/vc53jkkUc4ePAgq1at4otf/GIV7oCizG5ywyPc+sBuNt3Tw60P7C5ZsHty+9i6t5fpiNM7nfVnXjYb6fxarFkOLe1i8tPQfscrwRntevLkSW655RaeeOIJUqkUhw8fDnzehz/8Ya666io+/vGPs337djZv3mw97/7776evr49MJsM//MM/cPrppwNw5ZVXctppp804/5FHHuG+++4r/v6GN7yBf/7nf+aHP/wha9asAWBiYoJLL720rPerKK2CLStpe18/O/cNMDYRf4y5s/5cffHKkutGeU61aWkFMS+btd7YqJo7KiMjI6RSKebPn89nP/tZFixYwPe//32mp6eZO3du4HPf/OY3s2DBAr773e8yMDBQtCa8ODEIL1mf92KMmZGyaozht3/7t7n33nsjvjNFUWyeiMnpaSbLUA5wav1xxyKceMP45CQnxsd9n1NtWlpB2DR0OpXi6otXVu01jh07xkc/+lFuueUWRIQXX3yRzs5O2tra6OnpYSrC7uCmm27i+uuv50Mf+hCpVKoqcl1xxRXceeedfOlLXwLgl7/8JV1dXdx8880MDQ2xZMkSfv3rXzM6OsqyZcuq8pqKMltwJ7dUE+/60714UUkA2mut2J5TTVo6BtG9eBGb1nQXte+8bJZNa7orzgh45ZVXimmu73rXu7jiiiv49Kc/DcAf/MEf0NPTQ1dXF4cPH/bd4bu58sori0HlavGpT32KX/7yl1xwwQVceOGF7NmzhzPPPJMdO3bwwQ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z4e5TwOG4ciqKG+3mqiiKolhRF5OiKIpiRRWEoiiKYkUVhKIoimJFFYSiKIpiRRWEoiiKYkUVhKIoimJFFYSiKIpi5f8HsG+SdZI3PZ8AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# define the x & y data.\n",
    "x = price_data['exxon_price']\n",
    "y = price_data['oil_price']\n",
    "\n",
    "# create the scatter plot.\n",
    "plt.plot(x, y, 'o', color ='cadetblue', label = 'Daily Price')\n",
    "\n",
    "# make sure it's formatted.\n",
    "plt.title(\"Exxon Vs. Oil\")\n",
    "plt.xlabel(\"Exxon Mobile\")\n",
    "plt.ylabel(\"Oil\")\n",
    "plt.legend()\n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "***\n",
    "### Measure the Correlation\n",
    "At first glance, we can tell there is some relationship here because they seem to be moving in tandem. The relationship means if one goes up the other appears to go up as well and also tells us it appears to be a positive relationship because they both move up. However, if we would like to attach a number to this relationship so we can quantify it. Well, in this case, let us measure the correlation between the two variables. We will take the DataFrame and call the `corr()` method to return a DataFrame with the metrics."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# let's measure that correlation\n",
    "price_data.corr()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Okay, so there is a correlation and a strong one at that. Generally speaking, this is how we measure the strength of correlations.\n",
    "\n",
    " - Very strong relationship **(|r|>0.8 =>)**\n",
    " - Strong relationship **(0.6≤|r|)**\n",
    " - Moderate relationship **(0.4≤|r|)**\n",
    " - Weak relationship **(0.2≤|r|)**\n",
    " - Very weak relationship **(|r|)** \n",
    "\n",
    "***\n",
    "### Create a Statistical Summary\n",
    "Okay, so we see there is a correlation let us create a statistical summary to help describe the dataset. We will use the `describe()` method to output a DataFrame with all this info."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>exxon_price</th>\n",
       "      <th>oil_price</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>1248.000000</td>\n",
       "      <td>1248.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>84.802796</td>\n",
       "      <td>61.935000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>7.424687</td>\n",
       "      <td>19.288424</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>68.120003</td>\n",
       "      <td>26.010000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>80.190002</td>\n",
       "      <td>48.162500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>83.024998</td>\n",
       "      <td>57.120000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>88.529999</td>\n",
       "      <td>70.725000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>104.379997</td>\n",
       "      <td>115.190000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       exxon_price    oil_price\n",
       "count  1248.000000  1248.000000\n",
       "mean     84.802796    61.935000\n",
       "std       7.424687    19.288424\n",
       "min      68.120003    26.010000\n",
       "25%      80.190002    48.162500\n",
       "50%      83.024998    57.120000\n",
       "75%      88.529999    70.725000\n",
       "max     104.379997   115.190000"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# let's take a look at a statistical summary.\n",
    "price_data.describe()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Nothing stands out as a concern at this point, our range is healthy, and all the data falls within 3 Standard deviations of the mean. In other words, we do not seem to have any outliers that we need to worry with. They both have the same count so we look good there and we get a good idea of the min and max. Overall, we should be happy with the output."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "***\n",
    "### Checking for Outliers and Skewness\n",
    "We do not want outliers, and we want to make sure our data does not have skew because this could impact results in specific models. The first thing we will do is a plot a histogram for each column of data. The data will help us get a good idea of the distribution. Once, we have done that we will do some hard measurements to validate our visuals."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[<matplotlib.axes._subplots.AxesSubplot object at 0x000001801DE6EAC8>,\n",
       "        <matplotlib.axes._subplots.AxesSubplot object at 0x000001801DEA6710>]],\n",
       "      dtype=object)"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAEICAYAAABRSj9aAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAF+pJREFUeJzt3X2wXHV9x/H3xySGxyEELjTkgfAQLeCMIb1iWpBJg6OQmRpwpA3TQhLRaCeM4GgVbK3YIR1xikyxChMNSVB5iDyUDANqjFCKDokJDSEhI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NTJR0kSRTbDx8H7gc+0YqaJB2VzicAH6d4rlr5HPUbrIblwEVpD4WpwM7+t8G5Sz2zCNgUEd8qGS/djnsexSa5ZtV0sKRD+y8DH0n33w49tMdrv5XP0wCd0dut/CR4X04UH3a+BBxWMnYEsJJizXUlMLrJNX0deIKiyX4AjASOB1YDmyneZo5sYj3/TfHP5lHgrFY8RxQvxl7gDxRrNRcPVgPF29vvAE8DjwHdre6zJv6tzqB4K78eWJdOM1IfPZbGlwNjmljT8al3HgU2Av/Yih4qU1e5137Tn6dO7m0fAsHMLHOdtunGzMz2kYPezCxzDnozs8w56M3MMuegNzPLnIPezCxzDnozs8z9H5Vh7VNqHH6IAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "price_data.hist(grid = False, color = 'cadetblue')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Okay, so some of the data does appear to be skewed but not too much. However, we probably should verify this by taking some measurements. Two good metrics we can use are the kurtosis and skew, where kurtosis measure the height of our distribution and skew measures whether it is positively or negatively skewed. We will use the `scipy.stats` module to do the measurements."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Exxon Excess Kurtosis: 0.088'"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "'Oil Excess Kurtosis: 0.53'"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "'Exxon Skew: 0.66'"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "'Oil Skew: 1.0'"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# calculate the excess kurtosis using the fisher method. The alternative is Pearson which calculates regular kurtosis.\n",
    "exxon_kurtosis = kurtosis(price_data['exxon_price'], fisher = True)\n",
    "oil_kurtosis = kurtosis(price_data['oil_price'], fisher = True)\n",
    "\n",
    "# calculate the skewness\n",
    "exxon_skew = skew(price_data['exxon_price'])\n",
    "oil_skew = skew(price_data['oil_price'])\n",
    "\n",
    "display(\"Exxon Excess Kurtosis: {:.2}\".format(exxon_kurtosis))  # this looks fine\n",
    "display(\"Oil Excess Kurtosis: {:.2}\".format(oil_kurtosis))      # this looks fine\n",
    "\n",
    "display(\"Exxon Skew: {:.2}\".format(exxon_skew))          # moderately skewed\n",
    "display(\"Oil Skew: {:.2}\".format(oil_skew))              # moderately skewed, it's a little high but we will accept it."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can also perform a `kurtosistest()` and `skewtest()` on our data to test whether the data is normally distributed. With these two functions we test the null hypothesis that the kurtosis of the population from which the sample was drawn is that of the normal distribution: kurtosis = 3(n-1)/(n+1) & the null hypothesis that the skewness of the population that the sample was drawn from is the same as that of a corresponding normal distribution, respectively.\n",
    "\n",
    "However, there is a **big caveat** to this.  As our dataset grows larger, the chances of us rejecting the null hypothesis increases even if there is only slight kurtosis or skew. In other words, even if our dataset is slightly non-normal, we will reject the null hypothesis. These results are unrealistic because the chances of us having a perfectly normal dataset are very very slim, so we have to take these results with a grain of salt."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Exxon'"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "KurtosistestResult(statistic=0.7185349375030217, pvalue=0.47242751383320714)"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "'Oil'"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "KurtosistestResult(statistic=3.193868719980946, pvalue=0.0014037993965471192)"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "'Exxon'"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "SkewtestResult(statistic=8.770169400598549, pvalue=1.7839768456341654e-18)"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "'Oil'"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "SkewtestResult(statistic=12.471137868018896, pvalue=1.0728306198159923e-35)"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# perform a kurtosis test\n",
    "display('Exxon')\n",
    "display(stats.kurtosistest(price_data['exxon_price']))\n",
    "display('Oil')\n",
    "display(stats.kurtosistest(price_data['oil_price']))\n",
    "\n",
    "# perform a skew test\n",
    "display('Exxon')\n",
    "display(stats.skewtest(price_data['exxon_price']))\n",
    "display('Oil')\n",
    "display(stats.skewtest(price_data['oil_price']))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "If we look at the results above, we will reject the null hypothesis 3 out of 4 times, even with the data being slightly skewed or having mild kurtosis. This is why we always need to visualize the data and calculate the metrics before running these test."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "***\n",
    "\n",
    "**Kurtosis**\n",
    "- Any distribution with **kurtosis ≈3 (excess ≈0)** is called mesokurtic. This is a normal distribution\n",
    "- Any distribution with **kurtosis <3 (excess kurtosis <0)** is called platykurtic. Tails are shorter and thinner, and often its central peak is lower and broader.\n",
    "- Any distribution with **kurtosis >3 (excess kurtosis >0)** is called leptokurtic. Tails are longer and fatter, and often its central peak is higher and sharper.\n",
    "\n",
    "***\n",
    "\n",
    "**Skewness**\n",
    "- If skewness is **less than −1 or greater than +1**, the distribution is highly skewed.\n",
    "- If skewness is **between −1 and −½ or between +½ and +1**, the distribution is moderately skewed.\n",
    "- If skewness is **between −½ and +½**, the distribution is approximately symmetric."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Section Five: Build the Model\n",
    "At this point, we feel comfortable moving forward other than the data being slightly skewed nothing else is stopping us from going with the linear regression model.\n",
    "\n",
    "***\n",
    "### Split the Data\n",
    "The first thing we need to do is split the data into a training set and a test set. The training set is what we will train the model on and the test set is what we will test it on. The convention is to have 20% dedicated to testing and the remaining 80% to training, but these are not hard limits."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "# define our input variable (X) & output variable.\n",
    "Y = price_data.drop('oil_price', axis = 1)\n",
    "X = price_data[['oil_price']]\n",
    "\n",
    "# Split X and y into X_\n",
    "X_train, X_test, y_train, y_test = train_test_split(X, Y, test_size=0.30, random_state=1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "***\n",
    "### Create & Fit the model\n",
    "Making the model surprises many people of how easy this step is. All we do is create an instance of the linear regression model from Sklearn and then call the `fit()` method to train the model on our training data."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LinearRegression(copy_X=True, fit_intercept=True, n_jobs=None,\n",
       "         normalize=False)"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# create a Linear Regression model object.\n",
    "regression_model = LinearRegression()\n",
    "\n",
    "# pass through the X_train & y_train data set.\n",
    "regression_model.fit(X_train, y_train)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "***\n",
    "### Explore the output\n",
    "Let us see what got sent back to us. First, we can check the coefficient of each independent variable in our model. In this case, it is just the oil price. After that let us take a look at the intercept of our regression formula."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The Coefficient for our model is 0.24\n",
      "The intercept for our model is 70.01\n"
     ]
    }
   ],
   "source": [
    "# let's grab the coefficient of our model and the intercept.\n",
    "intercept = regression_model.intercept_[0]\n",
    "coefficient = regression_model.coef_[0][0]\n",
    "\n",
    "print(\"The Coefficient for our model is {:.2}\".format(coefficient))\n",
    "print(\"The intercept for our model is {:.4}\".format(intercept))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Interpreting the coefficient, we would say that a single unit increase in oil **is associated with a 0.24** increase in the price of Exxon Mobile stock. **We are NOT CLAIMING CAUSATION, just association.**"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "***\n",
    "### Taking a Single Prediction\n",
    "Now that we understand what the model looks like and how to interpret the output let us make some predictions. If we want we can make a single prediction by passing through a price in a list of list. Once we have an output, we slice it to get the value."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The predicted value is 85.95\n"
     ]
    }
   ],
   "source": [
    "# let's test a prediction\n",
    "prediction = regression_model.predict([[67.33]])\n",
    "predicted_value = prediction[0][0]\n",
    "print(\"The predicted value is {:.4}\".format(predicted_value))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "To interpret the output, we would say that given a barrel of oil for 67.33 we would predict Exxon Mobile to be trading for 85.95."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "***\n",
    "### Making Multiple Predictions at Once\n",
    "Great, so we have a good working model let us test it on the data we set aside. We will call the `predict()` method and pass through our `X_test` dataset at which point a list of predictions will be returned to us."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[82.23530265],\n",
       "       [82.87451035],\n",
       "       [81.48245802],\n",
       "       [78.9256272 ],\n",
       "       [84.01324704]])"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Get multiple predictions.\n",
    "y_predict = regression_model.predict(X_test)\n",
    "\n",
    "# Show the first 5 predictions\n",
    "y_predict[:5]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Section Six: Evaluating the Model"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Once we have a functioning model that we can use to make predictions we need to evaluate how useful our model is. There is no sense of using a model that makes horrible predictions, so we should look at different metrics to see how it did.\n",
    "\n",
    "Now to make this process easier on ourselves, we are going to recreate our same model using the `statsmodel.api` library. The reason why is that they have numerous built-in functions that make calculating metrics like confidence intervals and p-values a breeze. The output from the `statsmodel.api` will not be identical to our `sklearn` library but it will be very close."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\Alex\\Anaconda3\\lib\\site-packages\\numpy\\core\\fromnumeric.py:2389: FutureWarning: Method .ptp is deprecated and will be removed in a future version. Use numpy.ptp instead.\n",
      "  return ptp(axis=axis, out=out, **kwargs)\n"
     ]
    }
   ],
   "source": [
    "# define our intput\n",
    "X2 = sm.add_constant(X)\n",
    "\n",
    "# create a OLS model.\n",
    "model = sm.OLS(Y, X2)\n",
    "\n",
    "# fit the data\n",
    "est = model.fit()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "***\n",
    "### Confidence Intervals\n",
    "First, let us calculate confidence intervals. Keep in mind that by default that the calculated using 95% intervals. We interpret this by saying if the population from which this sample was drawn was sampled 100 times. Approximately 95 of those confidence intervals would contain the \"true\" coefficient.\n",
    "\n",
    "Why do we provide a confidence range? Well, it comes from the fact that we only have a sample of the population, not the entire population itself. Because of this concept, means that the \"true\" coefficient could exist in the interval below or it couldn't, but we cannot say for sure. We provide some uncertainty by providing a range, usually 95% interval, where the coefficient is probably in."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>const</th>\n",
       "      <td>69.358126</td>\n",
       "      <td>71.57579</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>oil_price</th>\n",
       "      <td>0.214372</td>\n",
       "      <td>0.24856</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   0         1\n",
       "const      69.358126  71.57579\n",
       "oil_price   0.214372   0.24856"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# make some confidence intervals, 95% by default.\n",
    "est.conf_int()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Interpreting the output above, we would say that with 95% confidence the `oil_price` coefficient **exists between 0.214 & 0.248**."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> - Want a narrower range? Decrease your confidence.\n",
    "> - Want a wider range? Increase your confidence."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "***\n",
    "### Hypothesis Testing\n",
    "\n",
    "- **Null Hypothesis:** There is no relationship between the price of oil and the price of Exxon.\n",
    "    - The coefficient equals 0.\n",
    "- **Alternative Hypothesis:** There is a relationship between the price of oil and the price of Exxon.\n",
    "    - The coefficient does not equal to 0.\n",
    "    \n",
    "- If we reject the null, we are saying there is a relationship, and the coefficient does not equal 0.\n",
    "- If we fail to reject the null, we are saying there is no relationship, and the coefficient does equal 0."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "const         0.000000e+00\n",
       "oil_price    1.423529e-123\n",
       "dtype: float64"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# estimate the p-values.\n",
    "est.pvalues"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The p-value represents the probability that the coefficient equals 0. We want a p-value that is less than 0.05 if it is we can reject the null hypothesis. In this case, the p-value for the oil_price coefficient is much lower than 0.05, so we can reject the null hypothesis and say that there is a relationship and that we believe it to be between oil and the price of Exxon."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Section Seven: Model Fit"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can examine how well our data fit the model, so we will take `y_predictions` and compare them to our `y_actuals` these will be our residuals. From here we can calculate a few metrics to help quantify how well our model fits the data. Here are a few popular metrics:\n",
    "\n",
    "- **Mean Absolute Error (MAE):** Is the mean of the absolute value of the errors. This metric gives an idea of magnitude but no idea of direction (too high or too low).\n",
    "\n",
    "- **Mean Squared Error (MSE):** Is the mean of the squared errors.MSE is more popular than MAE because MSE \"punishes\" more significant errors.\n",
    "\n",
    "- **Root Mean Squared Error (RMSE):** Is the square root of the mean of the squared errors. RMSE is even more favored because it allows us to interpret the output in y-units.\n",
    "\n",
    "Luckily for us, `sklearn` and `statsmodel` both contain functions that will calculate these metrics for us.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "MSE 38.4\n",
      "MAE 5.03\n",
      "RMSE 6.2\n"
     ]
    }
   ],
   "source": [
    "# calculate the mean squared error.\n",
    "model_mse = mean_squared_error(y_test, y_predict)\n",
    "\n",
    "# calculate the mean absolute error.\n",
    "model_mae = mean_absolute_error(y_test, y_predict)\n",
    "\n",
    "# calulcate the root mean squared error\n",
    "model_rmse =  math.sqrt(model_mse)\n",
    "\n",
    "# display the output\n",
    "print(\"MSE {:.3}\".format(model_mse))\n",
    "print(\"MAE {:.3}\".format(model_mae))\n",
    "print(\"RMSE {:.3}\".format(model_rmse))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "***\n",
    "## R-Squared\n",
    "The R-Squared metric provides us a way to measure the goodness of fit or how well our data fits the model. The higher the R-Squared metric, the better the data fit our model. However, we have to know the limitations of R-Square. One limitation is that R-Square increases as the number of feature increases in our model, so it does not pay to select the model with the highest R-Square. A more popular metric is the adjusted R-Square which penalizes more complex models. Let us calculate both."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "R2: 0.31\n"
     ]
    }
   ],
   "source": [
    "model_r2 = r2_score(y_test, y_predict)\n",
    "print(\"R2: {:.2}\".format(model_r2))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "With R-Square & adjusted R-Square, we have to be careful when interpreting the output because it depends on what our the goal is. The R-squared is generally of secondary importance unless the main concern is using the regression equation to make accurate predictions. It boils down to the domain-specific problem, and many people would argue an R-Square of .36 is great for stocks because it is hard to control for all the external factors, while others may not agree."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "***\n",
    "### Create a Summary of the Model Output\n",
    "Let us create a summary of some of our keep metrics, Sklearn does not have a good way of creating this output so we would have to calculate all the metrics ourselves. Let us avoid this and use the `statsmodel.api` library as we can create the same model we did up above, but we can also leverage the `summary()` method to create an output for us. Some of the metrics might differ slightly, but they generally should be the same"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# print out a summary\n",
    "print(est.summary())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now looking at the table above, we get a good overview of how our model performed and provides some of the key metrics we discussed up above. The only additional metric we will describe here is the t-value which is the coefficient divided by the standard error. The higher the t-value, the more evidence we have to reject the null hypothesis."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Plot the Residuals\n",
    "It's good to see how the residulas are distributed because they should be normally distributed."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAEICAYAAABPgw/pAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAEzVJREFUeJzt3X2wnGd93vHvhY2BgI3t6FgVNkIGBIGkg5yeODC0lNgYjCGR02JqJyFKRo1CTZJSyiSCSYY0TVvTKSFMGpMKTBFpeFEdHLukQ3DlEA8zQDgybuIXXNuyLBsr0nGw65ckNjK//rGPyiKfo92zZ1erc/P9zJzZfd5/99nZa++9d59nU1VIkla+p0y7AEnSeBjoktQIA12SGmGgS1IjDHRJaoSBLkmNMNB1zEqyLkklOX6IdX8myReORl19x1yb5JEkxy2y/NeT/LcxHauSvHAc+1K7DHSNRZI9SR5Psuqw+Td2YbRuOpV9xwvDI93fniRbl7vfqtpbVc+qqifGUae0XAa6xuku4JJDE0n+PvCM6ZXzJCdX1bOANwG/luS8aRckjZOBrnH6feCn+6Y3AR/rXyHJs5N8LMl8kruT/GqSp3TLjkvyn5Lcn2Q38IYFtr0iyb4kX0/ym4sNdxxJVc0BNwMb+vb9nCR/2NV1V5Jf6lt2dpK5JA8l2Z/kt7r53zEklOTMJH+W5OEk1wKr+vbx6iT3HtaePUle03eMLyZ5sGvff05ywkL1J7kgyS3dcb6e5J1L/R+oTQa6xulLwElJXtIF7T8DDh9D/h3g2cDzgX9M7wXgZ7tlPwe8ETgLmKXXk+63HTgIv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tA+YG1VnQW8A/h4kpMmVeMoRmzXUJdJOFYMaOMHgRcAG+g9Xu+barGjW1GPyRK9sqp+kN5w0tuSvGraBWmgsTyvlnMtlyOqqteMsM1jwGPd/V1J7gReBBwzH+yM0i5W2GUShm1jkg8Bn5lwOZOyoh6Tpaiq+7rbA0muoje8tNDnVSvR/iRrqmpfkjXAgWkXNA5Vtf/Q/eU8r46pIZckM4c+LEzyfGA9sHu6VY3FNcDFSZ6W5Ex67frzKdc0ku5JdMiP0/sgeCVq8tIVSZ6Z5MRD94HXsnIfo4VcA2zq7m8Crp5iLWMzrufVxHroR5Lkx4HfAWaAP05yY1W9DngV8BtJDgJPAG+tqol8eDAJi7Wrqm5OsgO4BTgIvK2qnphmrcvwH5NsoDc8sQf4+emWM5oxXbriWLQauCoJ9J7fH6+qz063pNEk+QTwamBVknuB9wCXATuSbAb2AhdNr8LRLNKuV4/jeeWp/5LUiGNqyEWSNDoDXZIaYaBLUiMMdElqhIEuSY0w0CWpEQa6JDXi/wEhjVSZULG1uwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Grab the residuals & then call the hist() method\n",
    "(y_test - y_predict).hist(grid = False, color = 'royalblue')\n",
    "plt.title(\"Model Residuals\")\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "***\n",
    "### Plotting our Line\n",
    "We have this beautiful model, but we cannot see it. Let us create a graph where we have our data and our linear regression line on our graph. We should also highlight some of our key metrics below so we should also add them below."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEWCAYAAAB8LwAVAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvd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ErCLt9eULJjP/KbgS622fT29vLwww9z7LHHAvDAAw/w5ptv8o9//ANVZZ999uGJJ55g1KhR3HXXXbzwwgv09PQwbdo0ttpqq77jLFu2jMcffxyAr3/963zve99jxx13ZMGCBeyxxx689tprXHzxxVxxxRXssMMOdHV1MXLkSObMmcMee+zBmWeeSW9vLytXruzXvueee47rr7+eZ599FlVl2223ZebMmYwdO5Y333yTW265hauvvpqvfvWr3HXXXXzjG9/I+T698MILvPLKK6y//vrssMMOPPXUU2y77bZ85zvf4Z577qGlpYXbbruNM888k+uuuy7n4xtGuUiiNhIRWlpaSubFFNaGUqm0BrWAqBTd3d1MnTqVd955h6222orddtsNcATEAw88wJZbbglAV1cXb775Jul0mn333ZfGxkYAvvKVr/Q73te+9rW+zw899BCvvvpq3/fly5eTTqfZYYcdOPXUUznssMM44IADGD9+PFtvvTXHHHMMa9asYb/99mPq1Kn9jvu3v/2N/fffn7XWWguAAw44gCeffJJ99tmHSZMm9W2/1VZb8c477+R1L7bZZhvGjx8P0HdPxowZw7x58/ruS29vL+utt15exzeMctHQ0JC4I/a7wRbT9TWsDaVSaZmKqQR4Noi2tjZWr17NFVdcAThTwdNPP50XX3yRF198kbfeeotjjz02dtrqdeAAmUyGp59+uu8YixYtIpVKMXv2bK655hq6u7vZbrvteP3115kxYwZPPPEEG2ywAYcffji/+13/uu9R5x0xYkTf5/r6+rxHKEHHUVU23XTTvmt4+eWXeeCBB/I6vmGUiyRqI1Wls7OznxtsMV1fm5qaBrh/l1KlNahnEEnUQKVknXXW4bLLLmPfffflW9/6FnvssQc/+tGPOOywwxg9ejSLFi1i2LBh7Ljjjpxwwgmcfvrp9PT0cN9993H88ccHHnP33Xfn8ssv5wc/+AEAL774IlOnTmX+/PlsvvnmbL755jz99NO8/vrrNDY2ssEGG3D88cezYsUKnn/+eY444oi+Y82YMYOjjjqK2bNno6r84Q9/4MYbbyz5fdloo43o6Ojg6aefZvvtt2fNmjX8+9//ZtNNNy35uQ0jX1KpFJ2dnX0x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nwVGA+ep6lxVPbmiDTSMAjABYRiFsQuwSlWvB1DVXuB7wDEisrdX38MwahETEIZRGJviZFDtQ1WX40TtfroiLTKMImECwjAKQwjOAhq23DBqBhMQhlEYrwDT/QvcIkefBOZXpEWGUSRMQBhGYTwMjBKRI8CpLQ78Aqf85coKtsswCsYEhGEUgDrZLvcHDhaRN4F/A6uAMyraMMMoApbN1TAMwwjEZhCGYRhGICYgDMMwjEBMQBiGYRiBmIAwDMMwAjEBYRiGYQRiAsIwDMMIxASEYRiGEcj/B0C2AG7Hp/89AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Oil coefficient:\u001b[1m0.24\u001b[0m\n",
      "Mean squared error: \u001b[1m38.44\u001b[0m\n",
      "Root Mean squared error: \u001b[1m6.2\u001b[0m\n",
      "R2 score: \u001b[1m0.31\u001b[0m\n"
     ]
    }
   ],
   "source": [
    "# Plot outputs\n",
    "plt.scatter(X_test, y_test,  color='gainsboro', label = 'Price')\n",
    "plt.plot(X_test, y_predict, color='royalblue', linewidth = 3, linestyle= '-',label ='Regression Line')\n",
    "\n",
    "plt.title(\"Linear Regression Exxon Mobile Vs. Oil\")\n",
    "plt.xlabel(\"Oil\")\n",
    "plt.ylabel(\"Exxon Mobile\")\n",
    "plt.legend()\n",
    "plt.show()\n",
    "\n",
    "# The coefficients\n",
    "print('Oil coefficient:' + '\\033[1m' + '{:.2}''\\033[0m'.format(regression_model.coef_[0][0]))\n",
    "\n",
    "# The mean squared error\n",
    "print('Mean squared error: ' + '\\033[1m' + '{:.4}''\\033[0m'.format(model_mse))\n",
    "\n",
    "# The mean squared error\n",
    "print('Root Mean squared error: ' + '\\033[1m' + '{:.4}''\\033[0m'.format(math.sqrt(model_mse)))\n",
    "\n",
    "# Explained variance score: 1 is perfect prediction\n",
    "print('R2 score: '+ '\\033[1m' + '{:.2}''\\033[0m'.format(r2_score(y_test,y_predict)))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Step Six: Save the Model for future use\n",
    "We will probably want to use this model in the future, so let us save our work so we can use it later. Saving the model can be achieved by storing our model in a pickle which is storing a python object as a character stream in a file which can be reloaded later to use."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[85.94980965]])"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pickle\n",
    "\n",
    "# pickle the model.\n",
    "with open('my_linear_regression.sav','wb') as f:\n",
    "     pickle.dump(regression_model,f)\n",
    "\n",
    "# load it back in.\n",
    "with open('my_linear_regression.sav', 'rb') as pickle_file:\n",
    "     regression_model_2 = pickle.load(pickle_file)\n",
    "\n",
    "# make a new prediction.\n",
    "regression_model_2.predict([[67.33]])"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
